package com.sky.zero.common.generate;


import com.sky.zero.common.generate.core.*;

import java.util.ArrayList;
import java.util.List;

public class GenerateRun {

    public static void main(String[] args) {
        // 数据库配置
        GenerateConfig.jdbcUrl = "jdbc:mysql://10.13.1.108:3306/cdw_base";
        GenerateConfig.jdbcUserName = "root";
        GenerateConfig.jdbcPassword = "sz.CDW!123";

        GenerateConfig.isCoverage = false;//强制覆盖已存在的类  true 是 false 否

        String packagePath = "com.sky.zero";

        List<GenerateBase> list = new ArrayList<>();
        // 表名,包名,类名
        list.add(new GenerateBase("sys_dict", "dict", "Dict"));

        // 执行生成方法
        for (GenerateBase base : list) {
            base.setPackagePath(packagePath);

            new GenerateApi(base).execute();// 生成Api
            new GenerateController(base).execute();// 生成Controller
            new GenerateService(base).execute();// 生成Service
            new GenerateMapper(base).execute();// 生成Mapper
            new GenerateXML(base).execute();// 生成 XML
            new GenerateEntity(base).execute();// 生成实体
        }
    }

}
